<?php

    class Zend_View_Helper_Categoryfilter extends Zend_View_Helper_Partial
    {

        public function getFilters()
        {
            $commonModel = new Application_Model_Common;
            $records = $commonModel->getAdapter()->select()->from(array('sc' => RKN_SUB_CATEGORY))
                    ->join(array('schild' => RKN_SUB_CHILD_CATEGORY), 'sc.scat_id = schild.schild_sub_id')
            ;

            $records = $records->query()->fetchAll();

            $data = array();
            foreach ($records as $rKey => $rVal)
            {
                $data['subcat'][$rVal['scat_id']]['cat_id'] = $rVal['cat_id']; 
                $data['subcat'][$rVal['scat_id']]['cat_name'] = $rVal['cat_name']; 
                $data['subcat'][$rVal['scat_id']]['childsub'][$rVal['schild_id']]['schild_sub_id'] = $rVal['schild_sub_id']; 
                $data['subcat'][$rVal['scat_id']]['childsub'][$rVal['schild_id']]['schild_name'] = $rVal['schild_name']; 
                $data['subcat'][$rVal['scat_id']]['childsub'][$rVal['schild_id']]['schild_id'] = $rVal['schild_id']; 
                
            }
            
            return $data;
        }
        
    }

?>
